class AddRelationshipOfGradeAndSubjectToUser < ActiveRecord::Migration
  def self.up
  	create_table :grades_users do |t|
      t.integer :user_id
      t.integer :grade_id

      t.timestamps
    end

    create_table :subjects_users do |t|
      t.integer :user_id
      t.integer :subject_id

      t.timestamps
    end
    
    create_table :ratings do |t|
      t.integer :user_id
      t.integer :question_id
      t.integer :value

      t.timestamps
    end
  end

  def self.down
  	drop_table :grades_users
  	drop_table :subjects_users
    drop_table :ratings    
  end
end
